package org.ix.dynamicapis.model.request;

import org.ix.dynamicapis.model.BaseEntity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import javax.validation.constraints.*;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@ApiModel(description = "接口配置保存请求实体")
@Getter
@Setter
@ToString
public class ApiSaveRequest extends BaseEntity {

    @ApiModelProperty(value = "接口ID", position = 1, required = true)
    @NotNull(message = "id(接口ID)不能为空")
    private Integer id;

    @ApiModelProperty(value = "所属业务系统", position = 2)
    private String systemCode;

    @ApiModelProperty(value = "数据来源", position = 3)
    private String datasource;

    @ApiModelProperty(value = "接口说明", position = 4)
    private String name;

    @ApiModelProperty(value = "版本 (格式：v主版本号-次版本号)", position = 5)
    private String version;

    @ApiModelProperty(value = "主题", position = 6)
    private String topic;

    @ApiModelProperty(value = "接口路径", position = 7)
    private String apiPath;

    @ApiModelProperty(value = "sql返回结果 (1:List, 2:Object)", position = 8)
    private Integer resultType;

    @ApiModelProperty(value = "MyBatis的执行sql", position = 9)
    private String mybatisSql;

    @ApiModelProperty(value = "是否有参数(0否, 1是)", position = 10)
    private Integer hasParams;

    @ApiModelProperty(value = "是否临时接口 (0否，1是)", position = 11)
    private Integer temporary;

    @ApiModelProperty(value = "过期时间", position = 12)
    private LocalDateTime expires;

    @ApiModelProperty(value = "是否可以缓存(0否, 1是)", position = 13)
    private Integer cacheable;

    @ApiModelProperty(value = "缓存时长 (单位:分钟，默认一天)", position = 14)
    private Integer cacheTime;

    @ApiModelProperty(value = "备注", position = 15)
    private String remark;

    @ApiModelProperty(value = "扩展信息", position = 16)
    private String extInfo;
}
